home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #2
/
Monster Media No. 2 (Monster Media)(1994).ISO
/
fonts
/
uspsbc.zip
/
USPSBC.MWM
< prev
next >
Wrap
Text File
|
1994-04-14
|
2KB
|
56 lines
Sub MAIN
Begin Dialog UserDialog 490, 136, "Postal Barcode Entry"
Text 10, 2, 469, 13, "Enter the Information Required to Generate a Postal Bar Code", .Text2
Text 130, 24, 124, 13, "5 Digit Zip Code", .Text1
TextBox 273, 19, 53, 18, .zipcode
Text 155, 45, 99, 13, "Zip + 4 Code", .Text3
TextBox 273, 41, 46, 18, .zip4
Text 97, 69, 159, 13, "Postal Delivery Point", .Text4
TextBox 273, 64, 28, 18, .deliverypoint
Text 12, 89, 465, 13, "Delivery Point is normally the last two digits of House Number", .Text5
OKButton 103, 110, 88, 21
CancelButton 283, 110, 88, 21
End Dialog
Dim Dlg As UserDialog
Choice = Dialog(Dlg)
csum = 0
If choice = - 1 Then
pbc$ = Dlg.zipcode + Dlg.zip4 + Dlg.deliverypoint
lpbc = Len(pbc$)
If (lpbc <> 5) And (lpbc <> 9) And (lpbc <> 11) Then
MsgBox "Incorrect Bar Code Length Must be {5,9,11} it is " + Str$(lpbc), "Postal Bar Code Entry Error"
choice = 0
Else
ercd = 0
For a = 1 To lpbc
tc$ = Mid$(pbc$, a, 1)
If (tc$ >= "0") And (tc$ <= "9") Then
csum = csum + Val(tc$)
Else
ercd = 1
EndIf
Next
If ercd = 1 Then
MsgBox "Invalid Character (non digit) in Bar Code", "Postal Bar Code Entry Error"
choice = 0
End If
End If
End If
If choice = - 1 Then
unval$ = Str$(csum)
undig$ = Right$(unval$, 1)
If undig$ = "0" Then
chkdgt$ = "0"
Else
chkdgt$ = Right$(Str$(10 - Val(undig$)), 1)
End If
pbc$ = "[" + pbc$ + chkdgt$ + "]"
FormatFont .Points = "12", .Underline = 0, .Color = 0, .Strikethrough = 0, .Superscript = 0, .Subscript = 0, .Hidden = 0, .SmallCaps = 0, .AllCaps = 0, .Spacing = "0 pt", .Position = "0 pt", .Kerning = 0, .KerningMin = "", .Tab = "0", .Font = "Postal Bar Codes 12pt", .Bold = 0, .Italic = 0
Insert pbc$
End If
End Sub